package world.liquor.service;

import java.sql.SQLException;
import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import world.liquor.dao.BeerDAOImpl;
import world.liquor.domain.BeerInfo;

@Service
public class BeerSearchService {

	private BeerDAOImpl dao;
	@Autowired
	public BeerSearchService(BeerDAOImpl dao){
		this.dao = dao;
	}
	
	public ArrayList<BeerInfo> selectAllBeer() throws SQLException{
		ArrayList<BeerInfo> list = dao.selectAllBeer();
		return list;
	}
	
	//맥주검색(이름-한/영 or 나라 or 제조사)
	public ArrayList<BeerInfo> searchBeerByMultipleCategory(String value) throws SQLException{
		ArrayList<BeerInfo> list = dao.selectBeerByMultipleCategory(value);
		return list;
	}
	
	//맥주검색: 단맛>3
	public ArrayList<BeerInfo> searchBeerBySweetness() throws SQLException{
		ArrayList<BeerInfo> list = dao.selectBeerBySweetness();
		return list;
	}
	//맥주검색: 쓴맛>3
	public ArrayList<BeerInfo> searchBeerByBitterness() throws SQLException{
		ArrayList<BeerInfo> list = dao.selectBeerByBitterness();
		return list;
	}
	//맥주검색: 청량>3
	public ArrayList<BeerInfo> searchBeerByRefreshment() throws SQLException{
		ArrayList<BeerInfo> list = dao.selectBeerByRefreshment();
		return list;
	}
	//맥주검색: 색=5(흑맥주)
	public ArrayList<BeerInfo> searchBlackBeer() throws SQLException{
		ArrayList<BeerInfo> list = dao.selectBlackBeer();
		return list;
	}
	//맥주검색: 알콜도수<5
	public ArrayList<BeerInfo> searchLowAlcoholBeer() throws SQLException{
		ArrayList<BeerInfo> list = dao.selectLowAlcoholBeer();
		return list;
	}
	//맥주검색: 알콜도수>10
	public ArrayList<BeerInfo> searchHighAlcoholBeer() throws SQLException{
		ArrayList<BeerInfo> list = dao.selectHighAlcoholBeer();
		return list;
	}
	//맥주검색: 알콜도수=0
	public ArrayList<BeerInfo> searchNoAlcoholBeer() throws SQLException{
		ArrayList<BeerInfo> list = dao.selectNoAlcoholBeer();
		return list;
	}
}
